/*
 * ArrayParameter.java July 2009
 *
 * Copyright (C) 2009, Quirino Zagarese <quirino@laszloitalia.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA  02111-1307  USA
 */
package org.eu4ria.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * This lets you specify the minimum and/or maximum length of an array passed as argument.
 * Only int, long, float, double, boolean, String arrays are supported.
 *
 * <pre>
 * [at]Action
 * public void setNewDouble(
 * 	[at]ArrayParameter(minlength=2, maxlength=10)int[] intArray){
 * 	this.intArray = intArray;
 * }
 * </pre>
 *
 * @author Quirino Zagarese
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface ArrayParameter {

	/**
	 * The minimum length of the array.
	 *
	 * @return the minimum length allowed
	 */
	public int minlength() default 0;

	/**
	 * The maximum length of the array.
	 *
	 * @return the maximum length allowed
	 */
	public int maxlength() default Integer.MAX_VALUE;

}
